<!DOCTYPE html>
<html>

<head lang="en">
    <title>找攻略</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategy.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        //文档加载完毕查询所有评论
        $(function () {
            //首先获取登录用户的id
            var user = JSON.parse(sessionStorage.getItem("user"));
            //获取登录用户的信息
            $.get("/users/" + user.id, function (data) {
                $(".info").renderValues(data, {getHref:function (item, value) {
                    var url = $(item).data("href");
                    $(item).attr("href", url + value);
                }})
            });

            //查询该用户所有评论
            //console.log(user);
            $.get("/comments/" + user.id, function (data) {
                $("#pills-all").renderValues(data, {
                    getHref: function (item, value) {
                        var url = $(item).data("href");
                        $(item).attr("href", url + value);
                    }
                })
            })


        })
    </script>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="../index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class="form-control searchBtn" placeholder="搜索我的评论">
            </div>
        </div>
    </div>
</div>

<div class="top">
    <div class="row">

        <div class="col-sm-6">
            <div class="info">
                <a data-href="/mine/profiles.html?id=" render-key="id" render-fun="getHref">
                    <img class="rounded-circle" width="20%" render-src="headImgUrl">
                    <p render-html="nickName"><strong></strong></p>
                    <p render-html="email"></p>
                </a>
                <hr>
            </div>
        </div>

        <div class="col-sm-6">
            <img src="/upload/92d5757c-594a-46d3-83bd-4d2d8c1a83a8.png" width="65%">
        </div>

        <!-- <div class="col-sm-2">
             <a class="nav-link active show" id="pills-top-all" data-toggle="pill" href="#pills-all">
                 <span style="font-weight:bold;font-family: 'Microsoft JhengHei UI Light';font-size:20px">我的评论</span>
             </a>
         </div>-->

    </div>
</div>


<div class="tab-content" id="pills-tabContent">
    <div class="tab-pane fade active show" id="pills-all">
        <div render-loop="dailyComments">
            <div class="container commend">
                <a data-href="/newsContent.html?id=" render-key="dailyComments.daily.id" render-fun="getHref">
                    <h6 style="color: #f5c6cb" render-html="dailyComments.daily.title"></h6>
                    <img render-src="dailyComments.daily.coverUrl">
                    <span>我的日报吐槽:</span>
                    <p render-html="dailyComments.content" style="font-size: 15px;color: #00bbd3;font-weight:bold"></p>
                    <hr>
                </a>
            </div>
        </div>

        <div render-loop="strategyComments">
            <div class="container commend">
                <a data-href="/strategyDetails.html?id=" render-key="strategyComments.strategy.id" render-fun="getHref">
                    <h6 style="color:#f5c6cb" render-html="strategyComments.strategy.title"></h6>
                    <img render-src="strategyComments.strategy.coverUrl">
                    <span>我的攻略吐槽:</span>
                    <p render-html="strategyComments.content"
                       style="font-size: 15px;color: #00bbd3;font-weight:bold"></p>
                    <hr>
                </a>
            </div>
        </div>

    </div>
</div>

</body>

</html>